package com.example.mail.controller;

import com.example.common.pojo.Employee;
import com.example.common.vo.RespBean;
import com.example.mail.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mail")
public class MailController {

    @Autowired
    private MailService mailService;

    @PostMapping("/emp")
    public RespBean sendEmpMail(@RequestBody Employee employee) throws Exception {

        mailService.sendEmp(employee);

        return RespBean.success();
    }
}
